<?php
include_once './model/news.php';
class NewsController {
	public function invoke () {
		$insertnews = new ModelNews();
		if (isset($_POST['JUDULBERITA']) and isset($_POST['ISIBERITA'])) {
			$news=$insertnews->addNews('adib', $_POST['JUDULBERITA'],$_POST['ISIBERITA']);
			if ($news) {
				header("location:./view/list_berita.php");
			} else {
				header('location:./view/form_berita.php');
			}
		} elseif (isset($_GET['news'])) {
			header("location:./view/list_berita.php");
		}
	}
}